/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.com.compassion.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/** Clase entidad para el mapeo de tabla de base de datos Planes
* @author grupo de Tesis
*/
@Entity
@Table(name = "planes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Planes.findAll", query = "SELECT p FROM Planes p"),
    @NamedQuery(name = "Planes.findByIdPlan", query = "SELECT p FROM Planes p WHERE p.idPlan = :idPlan"),
    @NamedQuery(name = "Planes.findByFecPlan", query = "SELECT p FROM Planes p WHERE p.fecPlan = :fecPlan"),
    @NamedQuery(name = "Planes.findByEstPlan", query = "SELECT p FROM Planes p WHERE p.estPlan = :estPlan"),
    @NamedQuery(name = "Planes.findByAuAddUsr", query = "SELECT p FROM Planes p WHERE p.auAddUsr = :auAddUsr"),
    @NamedQuery(name = "Planes.findByAuAddDat", query = "SELECT p FROM Planes p WHERE p.auAddDat = :auAddDat"),
    @NamedQuery(name = "Planes.findByAuModUsr", query = "SELECT p FROM Planes p WHERE p.auModUsr = :auModUsr"),
    @NamedQuery(name = "Planes.findByAuModDat", query = "SELECT p FROM Planes p WHERE p.auModDat = :auModDat")})
public class Planes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idPlan")
    private Integer idPlan;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecPlan")
    @Temporal(TemporalType.DATE)
    private Date fecPlan;
    @Basic(optional = false)
    @NotNull
    @Column(name = "estPlan")
    private int estPlan;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddUsr")
    private int auAddUsr;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddDat")
    @Temporal(TemporalType.DATE)
    private Date auAddDat;
    @Column(name = "AuModUsr")
    private Integer auModUsr;
    @Column(name = "AuModDat")
    @Temporal(TemporalType.DATE)
    private Date auModDat;
    @JoinColumn(name = "idBeneficiario", referencedColumnName = "idBeneficiario")
    @ManyToOne(optional = false)
    private Beneficiario idBeneficiario;

    public Planes() {
    }

    public Planes(Integer idPlan) {
        this.idPlan = idPlan;
    }

    public Planes(Integer idPlan, Date fecPlan, int estPlan, int auAddUsr, Date auAddDat) {
        this.idPlan = idPlan;
        this.fecPlan = fecPlan;
        this.estPlan = estPlan;
        this.auAddUsr = auAddUsr;
        this.auAddDat = auAddDat;
    }

    public Integer getIdPlan() {
        return idPlan;
    }

    public void setIdPlan(Integer idPlan) {
        this.idPlan = idPlan;
    }

    public Date getFecPlan() {
        return fecPlan;
    }

    public void setFecPlan(Date fecPlan) {
        this.fecPlan = fecPlan;
    }

    public int getEstPlan() {
        return estPlan;
    }

    public void setEstPlan(int estPlan) {
        this.estPlan = estPlan;
    }

    public int getAuAddUsr() {
        return auAddUsr;
    }

    public void setAuAddUsr(int auAddUsr) {
        this.auAddUsr = auAddUsr;
    }

    public Date getAuAddDat() {
        return auAddDat;
    }

    public void setAuAddDat(Date auAddDat) {
        this.auAddDat = auAddDat;
    }

    public Integer getAuModUsr() {
        return auModUsr;
    }

    public void setAuModUsr(Integer auModUsr) {
        this.auModUsr = auModUsr;
    }

    public Date getAuModDat() {
        return auModDat;
    }

    public void setAuModDat(Date auModDat) {
        this.auModDat = auModDat;
    }

    public Beneficiario getIdBeneficiario() {
        return idBeneficiario;
    }

    public void setIdBeneficiario(Beneficiario idBeneficiario) {
        this.idBeneficiario = idBeneficiario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPlan != null ? idPlan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Planes)) {
            return false;
        }
        Planes other = (Planes) object;
        if ((this.idPlan == null && other.idPlan != null) || (this.idPlan != null && !this.idPlan.equals(other.idPlan))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.compassion.entidades.Planes[ idPlan=" + idPlan + " ]";
    }
    
}
